# coding=gbk
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
# import warnings
# warnings.filterwarnings("ignore")
# import matplotlib as mpl

# data=pd.read_csv("births.csv",usecols=["year","births"])
# print(data.isnull())
data=pd.read_csv("births.csv")
data=data.dropna()
data=data.groupby("year").sum()
min=data["births"].min()
max=data["births"].max()
min_dat=data[data["births"]==min]
max_dat=data[data["births"]==max]
print(data.dtypes)
plt.figure(figsize=(10,10))
plt.plot(data["births"])
plt.annotate("min",xy=(1973,min_dat["births"]),xytext=(1973-5,min_dat["births"]-5),arrowprops={"facecolor":"k"})
plt.annotate("max",xy=(1988,max_dat["births"]),xytext=(1988-5,max_dat["births"]-5),arrowprops={"facecolor":"k"})
plt.show()
